package windows;


import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.WindowConstants;

import coordinators.Cordinator;


public class ManageRecipe extends JFrame 
{
	Cordinator cordinator;
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private ManageRecipeCreate manageRecipeCreate;
	private ManageRecipeModify manageRecipeModify;
	private ManageRecipeDelete manageRecipeDelete;
	private ManageRecipeShow manageRecipeShow;

	private JTabbedPane tbpPanels;

	

	public ManageRecipe(WindowPrincipal top)
	{
		super();
		setLayout(null);
		setSize(500,600);

		tbpPanels=new JTabbedPane();

		tbpPanels.setBounds(0,0,getWidth(),getHeight());

		manageRecipeCreate=new ManageRecipeCreate();
		manageRecipeCreate.setBounds(0,0,getWidth(),getHeight());
		manageRecipeCreate.setPreferredSize(manageRecipeCreate.getSize());

		manageRecipeModify =new ManageRecipeModify();
		manageRecipeModify .setBounds(0,0,getWidth(),getHeight());

		manageRecipeDelete=new ManageRecipeDelete();
		manageRecipeDelete.setBounds(0,0,getWidth(),getHeight());

		manageRecipeShow=new ManageRecipeShow();
		manageRecipeShow.setBounds(0,0,getWidth(),getHeight());

		tbpPanels.addTab("Crear Receta",manageRecipeCreate);
		tbpPanels.addTab("Modificar Receta", manageRecipeModify);
		tbpPanels.addTab("Eliminar Receta", manageRecipeDelete);
		tbpPanels.addTab("Mostrar Recetas", manageRecipeShow);

		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		this.addWindowListener(new WindowListener() 
		{
	        public void windowClosed(WindowEvent arg0) 
	        {	        	
	        	cordinator.ProcessCloseManageRecipe();
	        }
	        public void windowClosing(WindowEvent arg0) 
	        {
	        }
			public void windowActivated(WindowEvent e) 
			{
			}
			public void windowDeactivated(WindowEvent e) 
			{
			}
			public void windowDeiconified(WindowEvent e) 
			{
			}
			public void windowIconified(WindowEvent e) 
			{
			}
			public void windowOpened(WindowEvent e) 
			{
			}
		});
	
		
		
		getContentPane().add(tbpPanels);
		setTitle("Gestionar Receta");
		setLocation(250, 100);

	
	
	}

	public void setCoordinador(Cordinator c)
	{
		cordinator = c;

	}


}
